<?php
class ConnectDB{     
   private static $host = "localhost"; 
   private static $user = "root";  
   private static $pass = "";  
   public static $db = "proto2point1";     
  
   public static function connect(){  
      $db_conn = mysql_connect(self::$host, self::$user, self::$pass) or die("��Դ��Ͱҹ�����������");
      mysql_select_db(self::$db) or die("����͡�ҹ�����������");  
      mysql_query("SET NAMES TIS620"); 
	  //echo "�����������º���¤�� ����Ǿ�� sql ��";
   } 
   public static function Close_DB(){  
  	//	mysql_free_result($sql_result);
		mysql_close(); 
   }
   public function getdata($query){
   		     	    $strSQL = $query;
                    $objQuery = mysql_query($strSQL) or die("Error Query [" . $strSQL . "]");
                    $row = mysql_num_rows($objQuery);
                    $resultData = array();
                    for ($i = 0; $i < mysql_num_rows($objQuery); $i++) {
                        $result = mysql_fetch_array($objQuery);
                        array_push($resultData, $result);
                    }
                    return $resultData;
					
   }
   public function getrow($query)
   {
   					$strSQL = $query;
                    $objQuery = mysql_query($strSQL) or die("Error Query [" . $strSQL . "]");
                    $row = mysql_num_rows($objQuery);
					return $row;
   }
} 

?>